#include <fermat/common/number_parser.h>
#include <fermat/benchmark/fermat_benchmark.h>
#include <stdio.h>
#include <sstream>
#include <string>

std::string a ="1234.56";
std::string itype = "12345";

BENCHMARK(common, number_parser_double, 10, 1000)
{
    double b;
    bool ret = fermat::NumberParser::parseFloat(a, b);
    (void)ret;
}

BENCHMARK(common, number_parser_double_si, 10, 1000)
{
    double b;
    bool ret = fermat::NumberParser::parseFloatSi(a, b);
    (void)ret;
}

BENCHMARK(common, std_atof, 10, 1000)
{
    double b = ::atof(a.c_str());
    (void)b;
}

BENCHMARK(common, number_parser_atoi, 10, 1000)
{
    int64_t b;
    bool ret = fermat::NumberParser::atoi(a, b);
    (void)ret;
}

BENCHMARK(common, number_parser_parse64, 10, 1000)
{
    int64_t b;
    bool ret = fermat::NumberParser::parse64(a, b);
    (void)ret;
}

BENCHMARK(common, std_atoi, 10, 1000)
{
    int64_t b;
    b = ::atoi(a.c_str());
    (void)b;
}

BENCHMARK(common, std_atoix, 10, 1000)
{
    static std::string ax = "123M";
    int64_t b;
    bool ret = fermat::NumberParser::atoix(ax, b);
    (void)ret;
}